/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package specifications;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.nodes.Tag;

/**
 *
 * @author Jason
 */
public class ReferenceMaterials extends Parameter implements YamlObject<ReferenceMaterials> {
    public static final Tag TAG = new Tag("!ReferenceMaterials");
    private ArrayList<String> content;
    
    public ReferenceMaterials(){}
    public ReferenceMaterials(ArrayList<String> content){
        setPriority(5);
        this.content = content;
    }
    
    @Override
    public ArrayList<Directive> getDirectives() {
        return new ArrayList<Directive>(0);
    }

    @Override
    public void dump(String filename) throws IOException {
        Yaml yaml = new Yaml(CONSTRUCTOR, REPRESENTER);
        FileWriter writer = new FileWriter(filename);
        writer.write(yaml.dumpAs(this, TAG, DumperOptions.FlowStyle.BLOCK));
        writer.close();
    }

    @Override
    public ReferenceMaterials load(String filename) throws IOException {
        Yaml yaml = new Yaml(CONSTRUCTOR, REPRESENTER);
        FileReader reader = new FileReader(filename);
        ReferenceMaterials param = yaml.loadAs(reader, ReferenceMaterials.class);
        reader.close();
        return param;
    }


    /**
     * @return the content
     */
    public ArrayList<String> getContent() {
        return content;
    }

    /**
     * @param content the content to set
     */
    public void setContent(ArrayList<String> content) {
        this.content = content;
    }
    
}
